package com.ophiux.FeverManagement.infratructure.repository;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ophiux.FeverManagement.domain.entity.Authotity;
import com.ophiux.FeverManagement.domain.repository.IAuthotityRepositories;
import com.ophiux.FeverManagement.infratructure.mapper.authotity.AuthotityMapper;
import com.ophiux.utils.exception.OphiuxRepositoryException;

import lombok.extern.slf4j.Slf4j;

@Repository
@Slf4j
public class AuthotityRepositoriesImpl implements IAuthotityRepositories {
	@Autowired
	AuthotityMapper roleMapper;
	
	@Override
	public String save(Authotity model) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void delete(Object uniqueId) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Authotity selectOneByKey(Object uniqueId) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Authotity selectOne(Map map) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Authotity> selectAll(Map map) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean insert_default_authotity(Authotity authotity)  throws OphiuxRepositoryException{
		boolean inserPd = false;
		try {
			roleMapper.insert_default_authotity(authotity);
			
			inserPd = true;
		} catch (Exception e) {
			e.printStackTrace();
			log.info("RoleRepositoriesImpl=>insert_default_authotity(),数据库执行异常,异常信息",e);
			throw new OphiuxRepositoryException("RoleRepositoriesImpl=>insert_default_authotity(),数据库执行异常");
		}
		
		return inserPd;
	}


	
}
